import java.util.Scanner;

class ArrayUtils{
	public static PairResult findMinMax(double[] values){
		
		PairResult result=new PairResult();
		 result.max = values[0];
		result.min = values[0];
		
	for(int i=0;i<values.length;i++){
		if(values[i]>result.max) result.max=values[i];
		if(values[i]<result.min) result.min=values[i];
		
	}	
	
	return result;
		
	}
	
	
	static class PairResult{
		private double min;
		private double max;
		public double getMin() {
			return min;
		}
		public void setMin(double min) {
			this.min = min;
		}
		public double getMax() {
			return max;
		}
		public void setMax(double max) {
			this.max = max;
		}
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	
}
public class Main {

	public static void main(String[] args) {

		Scanner input=new Scanner(System.in);
		int n=input.nextInt();
		double[] array=new double[n];
		for(int i=0;i<array.length;i++){
			array[i]=input.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(array));
		System.out.println(ArrayUtils.PairResult.class);
	}

}
